DevOps

strace – Linux system call tracing and debugging utility

strace is a diagnostic and debugging utility for examining interactions between Linux processes and the kernel. It records system calls, signals and changes in process state, providing insight into what an application is doing at the operating system level.

Unlike source-level debuggers, strace does not require access to application source code or debugging symbols. This makes it particularly useful for investigating unexpected file access, permission failures, network connection problems and applications that behave differently across systems.

The utility can trace a program from startup or attach to an existing process. Its output identifies system calls, their arguments and returned results, making it possible to investigate failures and understand how applications use kernel services.

This is free and open source software.

Key Features

  • Trace system calls and signals generated by individual processes, including applications that are already running.
  • Filter system calls by name, regular expression or predefined categories covering files, networking, memory, processes and other operations.
  • Restrict tracing to activity involving selected file paths or file descriptors.
  • Display information associated with file descriptors, including file paths and socket details.
  • Inspect data read from and written to file descriptors, with hexadecimal and ASCII representations.
  • Record timestamps, elapsed time and system call execution duration.
  • Generate statistical summaries showing system call counts, execution times and errors.
  • Filter traced calls according to their return status.
  • Follow processes and threads created through operations such as fork, clone and vfork.
  • Capture stack traces to help relate system calls to their originating code paths.
  • Inject system call failures, modify return values and deliver signals to investigate application error handling.
  • Decode system call arguments and results to make low-level kernel interactions easier to interpret.

Website: github.com/strace/strace
Support:
Developer: Dmitry Levin
License: GNU Lesser General Public License v2.1

strace is written in C. Learn C with our recommended free books and free tutorials.


Related Software

Debuggers
LLDBNext generation, high-performance debugger
GhidraSoftware reverse engineering framework
DelveSource level debugger for the Go programming language
GDBThe GNU Debugger
ValgrindA memory debugger and profiler
Radare2Portable reversing framework
BugStalkerRust debugger
XdebugExtension for PHP to aid debugging and development
SeerGUI frontend to GDB
iaitoGraphical interface for radare2
KDbgGraphical user interface to GDB
straceDiagnostic, debugging and instructional userspace utility
rrRecord-and-replay debugger
gfLightweight GDB interface with source, stack and memory views
drgnProgrammable debugger that puts scripting at the centre
cgdbLightweight console frontend to the GNU debugger
PuDBConsole-based visual debugger for Python
nndPartially inspired by RemedyBG
bashdbSource-code debugger for bash; follows the GDB command syntax
PINCEMemory scanning, process manipulation and reverse engineering
edbLow-level debugging with disassembly and register inspection
SysprofProfile an application or entire system
crashLinux kernel crash analysis utility

Read our verdict in the software roundup.


Best Free and Open Source Software LinuxLinks helps you discover the best free and open source software for Linux. Explore our extensive collection of recommended applications, including alternatives to popular proprietary software.

We also publish software reviews, Linux tutorials, hardware reviews, free programming books and articles covering the wider open source community. Browse our Linux resources to discover more.

Know a useful free and open source Linux application we haven't covered? Suggest a program for inclusion.

Has your software been featured on LinuxLinks? Display one of our Featured on LinuxLinks badges on your website or GitHub README.
Subscribe

Please read our Comment Policy before commenting.

Notify of
guest
0 Comments
Oldest
Newest Most Voted